public class Exam02 {
    public static void main(String[] args) {
        String A="abcdee";
        char c=Repeat(A,5);
        System.out.println(c);
    }
    private  static char Repeat(String A,int n){
            Character ch = null;
            for (int i = 0; i < n; i++) {
                char c = A.charAt(i);
                if ((A.indexOf(c,i+1))!=-1) {
                    return  c;
                }
            }
            return ch;
        }

}
